package homework;

import java.lang.reflect.Method;
import java.util.ArrayList;

/*
ArrayList<Integer> list = new ArrayList<Integer>();
这个泛型为Integer的ArrayList中存放一个String类型的对象
*/
public class Test1 {
    public static void main(String[] args) throws Exception {
        ArrayList<Integer> list = new ArrayList<Integer>();
        Class clazz = list.getClass();
        Method method = clazz.getMethod("add", Object.class);
        method.invoke(list,"路明非");
        System.out.println(list);
    }
}
